<template>
  <div>
    <van-tree-select
        v-model:active-id="activeId"
        v-model:main-active-index="activeIndex"
        :items="items"
        @click-item="get_data()"
    />
  </div>
</template>

<script>
import { ref } from 'vue';

export default {
name: "left",
  data() {
    return {
      list:[],
      items: [],
      activeId:ref(1),
      activeIndex:ref()
    }
  },
  methods: {
  get_role:function (){

    this.myaxios("http://localhost:5000/get_roleqan", 'get', {'id':localStorage.getItem('userid')})
        .then(res => {
          console.log(res)
          this.items=res.data.list

        })
  },
    get_data:function(){
      // console.log('551')
      console.log(this.activeId)
      this.$emit('id',this.activeId)
    }
  },
  mounted() {
  this.get_role()
  }
}
</script>

<style scoped>

</style>
